from time import time

def bubble_sort(a):
    n = len(a) 
    for i in range(n - 1):
        for j in range(n - 1 - i):
            if a[j] > a[j + 1]: 
                a[j], a[j + 1] = a[j + 1], a[j]
    return a   

f1 = open('m1_sorted.txt')

a1 = f1.readlines()

f1.close()



b1 = []
for i in range(len(a1)):
    x1 = int(a1[i])
    b1.append(x1)


t0 = time()
c1 = bubble_sort(b1)
t1 = time()
print("m1_sorted", round((t1 - t0) * 1000), "milliseconds")


f1 = open('m2_reverse.txt')

a1 = f1.readlines()

f1.close()



b1 = []
for i in range(len(a1)):
    x1 = int(a1[i])
    b1.append(x1)


t0 = time()
c1 = bubble_sort(b1)
t1 = time()
print("m2_reverse", round((t1 - t0) * 1000), "milliseconds")


f1 = open('m3_shuffle.txt')

a1 = f1.readlines()

f1.close()



b1 = []
for i in range(len(a1)):
    x1 = int(a1[i])
    b1.append(x1)


t0 = time()
c1 = bubble_sort(b1)
t1 = time()
print("m3_shuffle", round((t1 - t0) * 1000), "milliseconds")



